package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author Lufuas
 * @version 1.0
 * @date 2019-10-21 10:31
 */
@RestController
public class DemoController {

    @Value("${spring.application.name:null}")
    private String name;

    @Value("${server.port:null}")
    private String port;

    @RequestMapping("/version")
    public String test(){
        return "["+name+"]["+port+"]["+new Date()+"]";
    }

}
